import request from '@/utils/request'

// 查询规格列表
export function list(query) {
  return request({
    url: '/shop/goodscategory/list',
    method: 'get',
    params: query
  })
}

// 查询规格详细
export function get(categoryId) {
  return request({
    url: '/shop/goodscategory/' + categoryId,
    method: 'get'
  })
}


// 新增规格
export function add(data) {
  return request({
    url: '/shop/goodscategory',
    method: 'post',
    data: data
  })
}

// 修改规格
export function update(data) {
  return request({
    url: '/shop/goodscategory',
    method: 'put',
    data: data
  })
}

// 删除规格
export function del(categoryId) {
  return request({
    url: '/shop/goodscategory/' + categoryId,
    method: 'delete'
  })
}

// 修改规格
export function enableCategory(data) {
  return request({
    url: '/shop/goodscategory/enable',
    method: 'put',
    data: data
  })
}
